package com.snack.system.service.impl;

import com.snack.system.domain.TsOrder;
import com.snack.system.mapper.TsOrderMapper;
import com.snack.system.service.ITsOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单Service业务层处理
 * 
 * @author snack
 * @date 2022-09-18
 */
@Service
public class TsOrderServiceImpl implements ITsOrderService 
{
    @Autowired
    private TsOrderMapper orderMapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public TsOrder selectById(Long orderId)
    {
        return orderMapper.selectById(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param order 订单
     * @return 订单
     */
    @Override
    public List<TsOrder> selectList(TsOrder order)
    {
        return orderMapper.selectList(order);
    }

    /**
     * 新增订单
     * 
     * @param order 订单
     * @return 结果
     */
    @Override
    public int insert(TsOrder order)
    {
        return orderMapper.insert(order);
    }

    /**
     * 修改订单
     * 
     * @param order 订单
     * @return 结果
     */
    @Override
    public int update(TsOrder order)
    {
        return orderMapper.update(order);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] orderIds)
    {
        return orderMapper.deleteByIds(orderIds);
    }
}
